|
|
Lance Birch <-> wrote:
> However, it's probably a lot of work to implement for very little gain.
I don't understand why. Parsing them is quite trivial, so coloring them
correctly should be too. Just increase a counter when /* is encountered
and decrease it when */ is encountered, When the counter gets back to 0,
that's the end of the comment.
Of course there may be ambiguous cases like this:
/*
#debug "Comments end with the */ symbol\n"
*/
However, I don't think it would be so difficult to make the syntax-coloring
algorithm to interpret that like the parser does (and in fact, if it does so,
it helps the user to immediately spot a potential problem with comments
if there exists one, as might be the case here).
In fact, I just checked and the above causes a syntax error in POV-Ray
because it doesn't "parse" strings inside comments. Thus coloring that
becomes quite simple, as I described above (ie. with a simple counter).
And as I said, the user would immediately spot the problem while editing
the text because the syntax coloring clearly shows that the comment is
ending somewhere he didn't expect.
--
- Warp
Post a reply to this message
|
|